import React, { PureComponent } from 'react'
import { connect } from 'react-redux'
import color from '../../../../utils/color'
import { BackIcon } from '../../../../widgets'
import CommonDetail from '../CommonDetail'

@connect(({ home, loading }) => ({ ...home, isLoading: loading.models.home }))
export default class extends PureComponent {
  static navigationOptions = ({ navigation }) => ({
    title: navigation.state.params.codeName,
    headerTintColor: 'white',
    headerStyle: {
      backgroundColor: color.theme,
      elevation: 0,
      shadowOpacity: 0,
    },
    headerLeft: ( <BackIcon backInvoke={() => { navigation.goBack(null) }}/>),
  })

  render() {
    return (
      <CommonDetail {...this.props}/>
    )
  }
}
